<include file="Public:header" /> <br>
<style>
		#selectlistmember14877304351104{padding:0; margin:0;}
		#selectlistmember14877304351104 .selectitem:hover{background-color:#eee;}
		#selectlistmember14877304351104 ul{padding-left:0;}
    #selectlistmember14877304351104 ul ul{padding-left:1em;}
    #selectlistmember14877304351104 ul li{list-style-type:none;}
	#selectlistmember14877304351104 ul li ul{display:none;}
	#selectlistmember14877304351104 ul li ul.open{display:block;}
	#selectlistmember14877304351104 .tree-btn{cursor: pointer;
  font-style: normal;
  border: 1px solid #ccc;
  line-height: 18px;
  background:#fff;
  display: inline-block; 
  margin-right: 5px;width:18px; height:18px; border-radius:2px; text-align:center;}
	
	#reselectmember14877304351104{box-shadow: 0 0 3px #eee; border:1px solid #ccc;}
	#reselectmemberinput14877304351104:hover{border-color:#999;}
	
	#reselectmemberinput14877304351104{cursor:pointer;width:400px; min-height:35px; line-height:35px; border:1px solid #ccc; background:#fff; padding:0 8px; border-radius:4px;}</style>
    
    <form class="form-inline selectlist pull-leftmemberselect" id="selectlistmember14877304351104form" action="/322?g=Intesys&amp;m=Team&amp;a=membergroup"><div class="panel" id="reselectmember14877304351104" style="width: 300px;">
		  <div class="panel-body"><div class="row" style="margin-bottom:15px;">
			  <div class="col-md-12">
				
				  <div class="input-group">
					  <input type="text" name="keywords" class="form-control" placeholder="请输入关键词匹配搜索">
					  <span class="input-group-btn">
					  <button type="submit" class="btn btn-default"><i class="fa icon-search"></i></button>
					  </span> </div>
				
			  </div>
			</div>
			<div id="selectlistmember14877304351104scroll" tabindex="1" style="overflow: hidden; outline: none;"><ul class="ui-sortable selectlist listloaded" id="selectlistmember14877304351104" style="height: 300px; overflow-x: hidden; opacity: 1;">
            

<!--onclick="return false;"--></ul>
			<div id="selectlistmember14877304351104pages"></div></div>
		  </div>
		</div></form>
    
    
    
    
<include file="Public:script" /> 

<script>
		function selectlistmember14877304351104close(){
			
		}
		function reselect14877304351104addLoadEvent(func) { 
			var oldonload = window.onload; 
				if (typeof window.onload != 'function') { 
				    window.onload = func;
				} else { 
				window.onload = function() { 
				    oldonload();
				func(); 
				} 
			} 
		}
		
		reselect14877304351104addLoadEvent(function(){
			
			
			//当控件存在时，不重新绑定事件，防止重复执行这个事件导致多次回调
			window.onload = function(){};
			

			
			$("#selectlistmemberform").addClass("binded");
			
			
			//防止多次绑定事件
			
			if(!$("#reselectmemberinput14877304351104").hasClass("binded")){
				$("#reselectmemberinput14877304351104").addClass("binded");
				$("#reselectmemberinput14877304351104").click(function(e) {
					var top = $(this).offset().top - $(document).scrollTop();
					var windowheight = $(window).height();
					var left = $(this).offset().left;
					var reselect = $("#reselectmember14877304351104");
					var reselectlayout = $("#reselectmemberlayout");
					var selectheight = reselect.height();
					if(windowheight - top - $(this).outerHeight() > reselect.outerHeight()){
						//alert(top + $(this).height());
						reselect.css({top: top + $(this).height() + "px", left: left + "px"});
					}else{
						
						reselect.css({top: top - reselect.outerHeight() + "px", left: left + "px"});
					}
					
					
					var windowwidth = $(window).width();
					var selectwidth = reselect.outerWidth();
					var left = reselect.css("left").replace("px", "")*1;
					var sw = windowwidth - (left + selectwidth);
					if(sw < 0){
						
						reselect.css({left: (left + sw) + "px"});
					}
					
					
					$("#selectlistmember14877304351104scroll").niceScroll({
                            styler: "fb",
                            cursorcolor: "#65cea7", 
                            cursorwidth: "3",
                            cursorborderradius: "0px",
                            background: "#424f63",
                            spacebarenabled: false,
                            cursorborder: "0"
                        });
					reselectlayout.show();
					reselect.show(50);
				});
			}
			
			
			
			$("#selectlistmember14877304351104").ajaxlist({success:function(){ 
				
				
				var reselect = $("#reselectmember14877304351104");
				var reselectlayout = $("#reselectmemberlayout");
				var reselectinput = $("#reselectmemberinput14877304351104");
				if(!reselectlayout.hasClass("binded")){
					reselectlayout.click(function(e) {
						reselectlayout.hide();
						reselect.hide();
					});
				}
				if(!$("#selectlistmember14877304351104").hasClass("listloaded")){
					//alert();
				$("#selectlistmember14877304351104").addClass("listloaded");
				
				}
				$("#selectlistmember14877304351104 em.tree-btn").each(function(){
					if($(this).parent().find("ul:eq(0)").length == 0){
						$(this).remove();
					}
				});
				$("#selectlistmember14877304351104 em.tree-btn").click(function(e){
					
					$("#selectlistmember14877304351104scroll").niceScroll({
                            styler: "fb",
                            cursorcolor: "#65cea7", 
                            cursorwidth: "3",
                            cursorborderradius: "0px",
                            background: "#424f63",
                            spacebarenabled: false,
                            cursorborder: "0"
                        });
					
					if($(this).parent().find("ul:eq(0)").hasClass("open")){
						$(this).parent().find("ul:eq(0)").removeClass("open");
						$(this).html("+");
					}else{
						$(this).parent().find("ul:eq(0)").addClass("open");
						$(this).html("-");
					}
				});
				
				
				reselect.find(".selectitem").click(function(e){
					$("#placeholder14877304351104").remove();
					
					if(reselectinput.attr("multi") == "1"){
						var selected = new Array();
						var selectdata = $(this).find(".dataitem");
						
						if(!selectdata.hasClass("clicked")){
							selectdata.find("input[type=\"hidden\"]").each(function(){
								$(this).attr("name", "member_"+$(this).attr("name")+"[]");
							});
							selectdata.addClass("clicked");
						}
						var reselectinputc;
						selectdata.find("input[type=\"hidden\"]").each(function(){
							reselectinputc = reselectinput.find("input[value=\""+$(this).attr("value")+"\"][name=\""+$(this).attr("name")+"\"]");
							if(reselectinputc.length > 0){
								selected.push(1);
							}
						});
						
						if(selectdata.find("input[type=\"hidden\"]").length == selected.length){
							$(this).removeClass("selected");
							reselectinputc.parent().remove();
							
						}else{
							$(this).addClass("selected");
							reselectinput.append(selectdata.html());
						}
						
						
						reselectinput.trigger("blur");
					}else{

						reselect.find(".selectitem").removeClass("selected");
						$(this).addClass("selected");
						var selectdata = $(this).find(".dataitem");
						if(!selectdata.hasClass("clicked")){
						    selectdata.find("input[type=\"hidden\"]").each(function(){
								
								
								
						        $(this).attr("name", "member_"+$(this).attr("name"));
						    });
							selectdata.addClass("clicked");
						}
						
						//alert($(this).find(".dataitem").html());
						reselectinput.html($(this).find(".dataitem").html());
						selectlistmember14877304351104close();
						reselectinput.trigger("blur");
					}
					
					reselectinput.find(".deletedata").each(function(index, element) {
						$(this).click(function(e) {
							$(this).parent().remove();
							reselectinput.trigger("blur");
							e.stopPropagation();
						});
						$(this).removeClass("deletedata");
					});
					
				});
			}});
			
		});
		</script>
</body></html>